package 富婆梦.第一阶段.第四周.作业;

/**
 * @ProjectName: java-learning
 * @Package: 富婆梦.第一阶段.第四周.作业
 * @ClassName: Bus
 * @Author: hemengjin
 * @Description: 公交车交通工具类，继承FourWheels类
 * @Date:2021/8/1 18:39
 * @Version: 1.0
 */
public class Bus extends FourWheels{
    int capacity=40;
    int speed;
    public int getCapacity(){
        return capacity;
    }
    public void start(){
        System.out.println(getClass()+"启动");
        speed=30;
    }
    public void stop(){
        System.out.println(getClass()+"刹车");
        speed=0;
    }
    public void speedUp(){
        System.out.println(getClass()+"加速");
        speed=70;
    }
    public void speedDown(){
        System.out.println(getClass()+"减速");
        speed=20;
    }
}
